#ifndef hash_h__
#define hash_h__

#include <inttype.h>

#ifdef __cplusplus
extern "C"{
#endif

typedef int32 (*get_hash)( void* );

typedef struct _hash_node
{
    void *key;
    void *val;
    struct _hash_node *next;
} hash_node;

typedef struct _hash
{
    hash_node *val;
	int32 size;
	int32 bound;
    get_hash get;
	compare cmp;
} hash ;

hash* hash_create( uint32 _sz, get_hash _get, compare _key_cmp );
void hash_destroy( hash* _sh );
void hash_put( hash* _sh, void* _key, void* _val );
void* hash_get( hash* _sh, void* _key );
void* hash_del( hash* _sh, void* _key );

#ifdef __cplusplus
};
#endif

#endif // hash_h__
